<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>企业药品管理（生产企业端）</title>
    <%@ include file="/WEB-INF/component/commonCSS.jsp" %> 
    <!--[if lt IE 9]>
        <script src="lib/js/html5shiv.min.js"></script>
        <script src="lib/js/respond.min.js"></script>
    <![endif]-->
</head>
<body class="skin-blue-light sidebar-mini fixed skin-blue-light-frame">
    <!-- 操作列更多弹窗 -->
    <div class="box box-primary" id="more" style="width:100px;height:35px;background-color:#2C3B41;position:absolute;z-index:9999;left:850px;top:100px;display:none;font-size:12px;border-top-color:#2C3B41;">
            <div class="box-body home-message" id="moreOp">
            </div>
    </div>

    <section class="content-header">
        <h1>企业药品管理</h1>
        <ol class="breadcrumb">
            <li><a href="${ctx}/home.jsp"><i class="fa fa-home"></i>首页</a></li>
            <li class="active"><a href="#">招标采购管理</a></li>
            <li class="active"><a href="#">企业药品管理</a></li>
        </ol>
    </section>
    <section class="content">
        <div class=" box box-success">
            <div class="box-body">
                <div class=" form-inline">
                    <div class="form-group form-group-xs">
                     <label>项目编码：</label>
                        <input class="form-control" id="projCode" name="projCode" type="text" placeholder="项目编码" />
                    </div>
                     <div class="form-group form-group-xs">
                        <label>项目名称：</label>
                        <input class="form-control" id=name name="name" type="text" placeholder="项目名称" />
                    </div>
                     
                    <button type="button" onclick="gridSerch();" class="btn btn-success btn-sm"> 查&nbsp;询</button>
                </div>
            </div>
        </div>
        <table class="jqgrid" id="gridlist"></table>
        <div id="gridpage"></div>
        

    </section>
    <%@ include file="/WEB-INF/component/commonJS.jsp" %> 
    <script type="text/javascript">
        
        $(function () {
            
            $("#gridlist").jqGrid({
                url: "${ctx}/prodProject/getMyProjectList.html",
                mtype: "POST",
                datatype: "json",
                autowidth: true,
                //shrinkToFit:false,
                height: 270,
                colNames: [ 'projId','项目编码','项目名称',  '简介', '创建日期','开始日期', '结束日期', '备注','状态','操作'],
                colModel: [
                    { name: 'projId', width: 120 ,hidden:true, align:"center",sortable: false},
                    { name: 'projCode', width: 60 , align:"center",sortable: false},
                    { name: 'name', width: 140 , align:"left",sortable: false},
                    { name: 'projIntro', width: 150 , align:"left" ,sortable: false},
                    { name: 'createDatetime', width: 80,hidden:true , align:"center" ,sortable: false},
                    { name: 'starttime', width: 60 , align:"center" ,sortable: false},
                    { name: 'endtime', width: 60 , align:"center" ,sortable: false},
                    { name: 'remark', width: 100 , align:"left" ,sortable: false},
                    { name: 'status', width: 40 ,hidden:true, align:"center" ,sortable: false},
                    { name: 'operate', width: 70 , align:"center" ,sortable: false, 
                        formatter : function(val, opts, rowdata) {
                            var str = "";
                            str +="<a href='${ctx}/prodDrug/toProdDrugList.html?projId=" + rowdata.projId + "' style=\"display:block;height:24px;width:60px;margin:0 ;padding:0 ;float:left;line-height:24px\">药品申报</a>";
                            str +="<div id='"+rowdata.projId+"d' onmouseover=\"over('"+rowdata.projId+"');\" style='height:24px;width:40px;margin:0 ;padding:0 ;float:left;line-height:24px'><a>更多...</a></div>";
                            return str;
                            }
                    }
                ],
                rowNum: 20,
                rowList: [10,20,50,100],
                rownumbers: true,
                pager: "#gridpage",
                //multiselect: true, 
                viewrecords: true,
                caption: "采购项目列表",
                jsonReader: {
                    repeatitems: false,
                    id: "projId"
                }
            });
            $("#gridlist").jqGrid('navGrid', '#gridpage', { add: false, edit: false, del: false, search: false, refresh: false });
            $(window).trigger("resize");  
            
        });
        

        //查询
        function gridSerch() {
            var projCode = $.trim($("#projCode").val());
            var name = $.trim( $("#name").val());
            $("#gridlist").jqGrid('setGridParam',{  
                datatype:'json',
                postData:{"projCode":projCode,
                        "name":name}
            }).trigger("reloadGrid"); //重新载入  
        }
        
        
      //更多弹窗 包含     资审结果查看、 资审澄清、资审公示查看
        //鼠标离开弹窗消失
        var flag = false;
        var mouseX=0;
        var mouseY=0;
        $(document).mousemove(function(e){
              mouseX=e.pageX;
              mouseY=e.pageY;
              var coord=$("#more").offset();
              if((mouseX<coord.left||mouseX>(coord.left+$("#more").width())||mouseY<coord.top||
                      mouseY>(coord.top+$("#more").height()))&&(mouseX<(coord.left+$("#more").width())||
                              mouseX>(coord.left+$("#more").width()+50)||mouseY<(coord.top+1)||mouseY>(coord.top+24+1))){
                  $("#more").hide();
              } 
        }); 
        //鼠标移入
        function over(id,status,prodCompId){
            $("#moreOp").children().remove();
            var coord=$("#"+id+"d").offset();
            $("#more").css("top",coord.top-1);
            $("#more").css("left",coord.left-$("#more").width());
            $("#more").show();
            $("#more").css("height",85);
            $("#more").css("padding-top",6);
            $("#moreOp").append("<a id='"+id+"w'  href='${ctx}/prodDrug/toDrugAuditResultList.html?projId="+id+"' style='color:#fff'>药审结果查看</a>");
            $("#moreOp").append("<br/>")
            $("#moreOp").append("<a id='"+id+"x'  href='${ctx}/prodDrug/toDrugComplainList.html?projId="+id+"' style='color:#fff'>药审澄清</a>");
            $("#moreOp").append("<br/>")
            $("#moreOp").append("<a id='"+id+"x'  href='${ctx}/prodDrug/toDrugComplainResultList.html?projId="+id+"' style='color:#fff'>药审澄清结果</a>");
            $("#moreOp").append("<br/>")
            $("#moreOp").append("<a id='"+id+"x'  href='${ctx}/prodDrug/toProdDrugList.html?projId="+id+"' style='color:#fff'>药审公示查看</a>");
        }
     
        
        
 
    </script>
</body>
</html>